<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <p>vue2的基本使用</p>

    <ul>
        <li v-for="ele in userInfo">{{ ele }}</li>
    </ul>

    <button @click="changeHandler">操作数据</button>

</div>
</body>
<script src="js/vue3.js"></script>

<script type="text/javascript">

    function reactive(obj) {
        return new Proxy(obj, {
            get(target, p, receiver) {
                return Reflect.get(target, p, receiver);
            },
            set(target, p, value, receiver) {
                Reflect.set(target, p, value, receiver);

                return true;

            }
        });
    }


    const  state = reactive( {
        id: 12,
        name: 'andy',
        get value() {
            return this.name;
        }
    } );


    state.name = 'mark';

    console.log(state);

</script>

</html>
